package com.self.liu.main;

public class MainDemo {

    public static void main(String[] args) throws InterruptedException {
        new Thread() {
            @Override
            public void run() {
                super.run();
                int num = 0;
                while (true) {
                    num++;
                    test(num);
                }
            }
        }.start();

        new Thread() {
            @Override
            public void run() {
                super.run();
                try {
                    showJVM();
                } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        }.start();
    }

    public static void showJVM() throws InterruptedException {
        while (true) {
            Thread.sleep(1000);
            //System.gc();
            //new JVMResource().printSummary();
        }
    }

    public static void test(int num) {
        TestDemo mo = new TestDemo("ID" + num, "Name" + num);
    }
}
